﻿using System.Collections.Generic;
using System.IO;

namespace CID.Tests.Support.Configuration.Database
{
    class ScriptProvider
    {
        private string scriptsBasePath;

        public ScriptProvider(string scriptsBasePath)
        {
            this.scriptsBasePath = scriptsBasePath;
        }

        public IEnumerable<string> GetScriptList()
        {
            var result = new List<string>();
            result.AddRange(Directory.EnumerateFiles(Path.GetFullPath(scriptsBasePath), "*.sql", SearchOption.AllDirectories));
            result.Sort();
            return result;
        }
    }
}
